package cn.b.sky.mes.mm.model;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;

import cn.b.sky.common.model.ImeCommon;
import org.apache.commons.lang3.StringUtils;
import cn.b.sky.user.SecurityContextUtil;

/**
 * 
 * <strong>Title : Distribution.java<br></strong>
 * <strong>Package : cn.b.sky.mes.mm.model<br></strong>
 * <strong>Description : </strong>配送需求实体类<br> 
 * <strong>Create on : 2016-9-19 下午3:02:23<br></strong>
 * <p>
 * @author JinQuan.Fu<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人|修改日期|修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
public class Distribution extends ImeCommon {

  /**
   * 配送编号
   */
  private String distributionNum;

  /**
   * 需求编号
   */
  private String requirementNum;

  /**
   * 物料编号
   */
  private String materialCode;

  /**
   * 物料描述
   */
  private String materialText;

  /**
   * 物料规格
   */
  private String materialSpec;

  /**
   * 需配数量
   */
  private Double distributionQuantity;

  /**
   * 实发数量
   */
  private Double actualQuantity = 0.0;

  /**
   * 配送方式编号
   */
  private String distributionModeCode;

  /**
   * 配送方式描述
   */
  private String distributionModeText;

  /**
   * 拉动策略编号
   */
  private String pullStrategyCode;

  /**
   * 拉动策略描述
   */
  private String pullStrategyText;

  /**
   * 需求触发策略编号
   */
  private String requirementTriggerModeCode;

  /**
   * 需求触发策略描述
   */
  private String requirementTriggerModeText;

  /**
   * 配送触发策略编号
   */
  private String distributionTriggerModeCode;

  /**
   * 配送触发策略描述
   */
  private String distributionTriggerModeText;

  /**
   * 状态编号
   */
  private String statusECode;

  /**
   * 关闭日期
   */
  @DateTimeFormat(iso = ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
  private Date closeDateTime;

  /**
   * 关闭人
   */
  private String closeUser;

  /**
   * 工作中心编号
   */
  private String workCenterCode;

  /**
   * 工作中心描述
   */
  private String workCenterText;

  /**
   * 作业单元编号
   */
  private String workUnitCode;

  /**
   * 作业单元描述
   */
  private String workUnitText;

  /**
   * 线边仓库编号
   */
  private String warehouseCode;

  /**
   * 线边仓库描述
   */
  private String warehouseText;

  /**
   * 线边库位编号
   */
  private String locationCode;

  /**
   * 配送人员
   */
  private String distributionUser;

  /**
   * 需求编号
   */
  private String requirementCode;

  /**
   * 更新版本
   */
  private Integer updateVersion = 0;

  public String getDistributionNum() {
    return distributionNum;
  }

  public void setDistributionNum(String distributionNum) {
    this.distributionNum = distributionNum;
  }

  public String getRequirementNum() {
    return requirementNum;
  }

  public void setRequirementNum(String requirementNum) {
    this.requirementNum = requirementNum;
  }

  public String getMaterialCode() {
    return materialCode;
  }

  public void setMaterialCode(String materialCode) {
    this.materialCode = materialCode;
  }

  public String getMaterialText() {
    return materialText;
  }

  public void setMaterialText(String materialText) {
    this.materialText = materialText;
  }

  public String getMaterialSpec() {
    return materialSpec;
  }

  public void setMaterialSpec(String materialSpec) {
    this.materialSpec = materialSpec;
  }

  public String getDistributionModeCode() {
    return distributionModeCode;
  }

  public void setDistributionModeCode(String distributionModeCode) {
    this.distributionModeCode = distributionModeCode;
  }

  public String getDistributionModeText() {
    return distributionModeText;
  }

  public void setDistributionModeText(String distributionModeText) {
    this.distributionModeText = distributionModeText;
  }

  public String getPullStrategyCode() {
    return pullStrategyCode;
  }

  public void setPullStrategyCode(String pullStrategyCode) {
    this.pullStrategyCode = pullStrategyCode;
  }

  public String getPullStrategyText() {
    return pullStrategyText;
  }

  public void setPullStrategyText(String pullStrategyText) {
    this.pullStrategyText = pullStrategyText;
  }

  public String getRequirementTriggerModeCode() {
    return requirementTriggerModeCode;
  }

  public void setRequirementTriggerModeCode(String requirementTriggerModeCode) {
    this.requirementTriggerModeCode = requirementTriggerModeCode;
  }

  public String getRequirementTriggerModeText() {
    return requirementTriggerModeText;
  }

  public void setRequirementTriggerModeText(String requirementTriggerModeText) {
    this.requirementTriggerModeText = requirementTriggerModeText;
  }

  public String getDistributionTriggerModeCode() {
    return distributionTriggerModeCode;
  }

  public void setDistributionTriggerModeCode(String distributionTriggerModeCode) {
    this.distributionTriggerModeCode = distributionTriggerModeCode;
  }

  public String getDistributionTriggerModeText() {
    return distributionTriggerModeText;
  }

  public void setDistributionTriggerModeText(String distributionTriggerModeText) {
    this.distributionTriggerModeText = distributionTriggerModeText;
  }

  public String getStatusECode() {
    return statusECode;
  }

  public void setStatusECode(String statusECode) {
    this.statusECode = statusECode;
  }

  public Date getCloseDateTime() {
    return closeDateTime;
  }

  public void setCloseDateTime(Date closeDateTime) {
    this.closeDateTime = closeDateTime;
  }

  public String getCloseUser() {
    return closeUser;
  }

  public void setCloseUser(String closeUser) {
    this.closeUser = closeUser;
  }

  public String getWorkCenterCode() {
    return workCenterCode;
  }

  public void setWorkCenterCode(String workCenterCode) {
    this.workCenterCode = workCenterCode;
  }

  public String getWorkCenterText() {
    return workCenterText;
  }

  public void setWorkCenterText(String workCenterText) {
    this.workCenterText = workCenterText;
  }

  public String getWorkUnitCode() {
    return workUnitCode;
  }

  public void setWorkUnitCode(String workUnitCode) {
    this.workUnitCode = workUnitCode;
  }

  public String getWorkUnitText() {
    return workUnitText;
  }

  public void setWorkUnitText(String workUnitText) {
    this.workUnitText = workUnitText;
  }

  public String getWarehouseCode() {
    return warehouseCode;
  }

  public void setWarehouseCode(String warehouseCode) {
    this.warehouseCode = warehouseCode;
  }

  public String getWarehouseText() {
    return warehouseText;
  }

  public void setWarehouseText(String warehouseText) {
    this.warehouseText = warehouseText;
  }

  public String getLocationCode() {
    return locationCode;
  }

  public void setLocationCode(String locationCode) {
    this.locationCode = locationCode;
  }

  public String getDistributionUser() {
    return distributionUser;
  }

  public void setDistributionUser(String distributionUser) {
    this.distributionUser = distributionUser;
  }

  public String getRequirementCode() {
    return requirementCode;
  }

  public void setRequirementCode(String requirementCode) {
    this.requirementCode = requirementCode;
  }

  public Integer getUpdateVersion() {
    return updateVersion;
  }

  public void setUpdateVersion(Integer updateVersion) {
    this.updateVersion = updateVersion;
  }

  public Double getDistributionQuantity() {
    return distributionQuantity;
  }

  public void setDistributionQuantity(Double distributionQuantity) {
    this.distributionQuantity = distributionQuantity;
  }

  public Double getActualQuantity() {
    return actualQuantity;
  }

  public void setActualQuantity(Double actualQuantity) {
    this.actualQuantity = actualQuantity;
  }

  @Override
  public String getSiteCode() {
    if (StringUtils.isEmpty(super.getSiteCode())) {
      return SecurityContextUtil.getSiteCode();
    }
    return super.getSiteCode();
  }

}
